<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>邮箱历史</h2>
    </div>

<div class="with-padding">
<div class="btn-group">
    <a class="btn" href="{:U('Admin/Addons/adminList',array('name'=>'Mail'))}">邮件配置</a>
    <a class="btn" href="{:addons_url('Mail://Mail/mailList')}">邮箱列表</a>
    <a class="btn" href="{:addons_url('Mail://Mail/sendEmail')}">发送邮件</a>
    <a class="btn btn-warning" href="{:addons_url('Mail://Mail/history')}">邮件历史</a>
</div>
</div>
<div class="with-padding">



    <php>
        $show=0;
        foreach($searches as $search){
            if(!empty($_REQUEST[$search['name']])){
                $show=1;
                break;
            }
        }
    </php>

    <div style="margin-bottom: 10px;">
        <!-- 高级搜索 -->
        <div class="search-form pull-right">
            <form action="{:addons_url('Mail://Mail/history')}" method="get">
            <div class="input-group">
                <input type="text" name="title" class="text form-control pull-left search-input" value="{:I('title')}" placeholder="请输入邮件标题">
                <span class="input-group-btn"><input type="button" url="{:addons_url('Mail://Mail/history')}" id="search" class="btn btn-primary" value="确定"/></span>
            </div>
            </form>
        </div>
    <!-- 按钮工具栏 -->
    <div class="cf">
        <div class="fl">

            <button class="btn submit-btn" url="?status=-1" target-form="ids" style="padding: 6px 16px;" onclick="toggle_search()">搜索</button>

            <button class="btn ajax-post btn" url="{:addons_url('Mail://Mail/setStatus',array('status'=>-1))}" target-form="ids">删除</button>

        </div>
    </div>
    </div>


    <form action="{:addons_url('Mail://Mail/sendEmail')}" method="post">

            <table class="table table-bordered table-striped">
                <thead>
                <tr>
                    <th class="row-selected">
                        <input class="checkbox check-all" type="checkbox">
                    </th>
                    <th>ID</th>
                    <th>标题</th>
                    <th>邮件内容</th>
                    <th>寄件人</th>
                    <th>创建时间</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="mailList">
                    <volist name="mailList" id="vo">


                        <tr>
                            <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$vo.id}"></td>
                            <td>{$vo.id}</td>
                            <td><a href="{:addons_url('Mail://Mail/mailDetail',array('id'=>$vo['id']))}">{$vo.title}</a></td>
                            <td>{$vo.body}</td>
                            <td>{$vo.from}</td>
                            <td>{$vo.create_time|friendlyDate}</td>

                        </tr>


                    </volist>
                    <else/>
                    <td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
                </notempty>
                </tbody>
            </table>

    </form>
    </div>
</block>

<block name="script">
<script type="text/javascript">
$(function(){
    Think.search("#search");
});
</script>
</block>